{extend name='base'}
{block name='content'}
<!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4>视频列表</h4>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>支付编号</th>
                                    <th>支付订单号</th>
                                    <th>图书名称</th>
                                    <th>购买人</th>
                                    <th>支付金额</th>
                                    <th>支付状态</th>
                                    <th>发货状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $payList as $v}
                                <tr>
                                    <td>{$v.pay_id}</td>
                                    <td>{$v.pay_out_trade_no}</td>
                                    <td>{$v.book.book_name}</td>
                                    <td>{$v.user.user_name}</td>
                                    <td>{$v.pay_price}</td>
                                    {if $v.pay_payed==0}
                                    <td class="text-danger">未支付</td>
                                    {else /}
                                    <td class="text-success">已支付</td>
                                    {/if}

                                    {if $v.pay_state==0}
                                    <td class="text-danger">未发货</td>
                                    {elseif $v.pay_state==1 /}
                                    <td class="text-success">已发货</td>
                                    {else /}
                                    <td class="text-success">已收货</td>
                                    {/if}
                                    <td>
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-default"  onclick="openexpress('{:url("admin/pay/saveexpress",["pay_id"=>$v.pay_id])}')">发货</a>
                                            <a class="btn btn-xs btn-default" href="" >查看物流</a>

                                        </div>
                                    </td>
                                </tr>
                                {/foreach}

                                </tbody>
                            </table>
                        </div>


                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
<!--End 页面主要内容-->
<script>
    layui.use('layer', function(){
        var layer = layui.layer;

    };
</script>
<script>
    function openexpress(url){
        layer.open({
            title:"填写快递单号",
            type: 2,
            content: url,
            area: ['250px', '100px']
        });
    }
</script>
{/block}